package com.ruoyi.project.personal.lifephoto.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.personal.lifephoto.mapper.UserLifePhotoMapper;
import com.ruoyi.project.personal.lifephoto.domain.UserLifePhoto;
import com.ruoyi.project.personal.lifephoto.service.IUserLifePhotoService;

/**
 * 生活照Service业务层处理
 * 
 * @author wyh
 * @date 2024-06-16
 */
@Service
public class UserLifePhotoServiceImpl implements IUserLifePhotoService 
{
    @Autowired
    private UserLifePhotoMapper userLifePhotoMapper;

    /**
     * 查询生活照
     * 
     * @param id 生活照主键
     * @return 生活照
     */
    @Override
    public UserLifePhoto selectUserLifePhotoById(Long id)
    {
        return userLifePhotoMapper.selectUserLifePhotoById(id);
    }

    /**
     * 查询生活照列表
     * 
     * @param userLifePhoto 生活照
     * @return 生活照
     */
    @Override
    public List<UserLifePhoto> selectUserLifePhotoList(UserLifePhoto userLifePhoto)
    {
        return userLifePhotoMapper.selectUserLifePhotoList(userLifePhoto);
    }

    /**
     * 新增生活照
     * 
     * @param userLifePhoto 生活照
     * @return 结果
     */
    @Override
    public int insertUserLifePhoto(UserLifePhoto userLifePhoto)
    {
        userLifePhoto.setCreateTime(DateUtils.getNowDate());
        return userLifePhotoMapper.insertUserLifePhoto(userLifePhoto);
    }

    /**
     * 修改生活照
     * 
     * @param userLifePhoto 生活照
     * @return 结果
     */
    @Override
    public int updateUserLifePhoto(UserLifePhoto userLifePhoto)
    {
        userLifePhoto.setUpdateTime(DateUtils.getNowDate());
        return userLifePhotoMapper.updateUserLifePhoto(userLifePhoto);
    }

    /**
     * 批量删除生活照
     * 
     * @param ids 需要删除的生活照主键
     * @return 结果
     */
    @Override
    public int deleteUserLifePhotoByIds(Long[] ids)
    {
        return userLifePhotoMapper.deleteUserLifePhotoByIds(ids);
    }

    /**
     * 删除生活照信息
     * 
     * @param id 生活照主键
     * @return 结果
     */
    @Override
    public int deleteUserLifePhotoById(Long id)
    {
        return userLifePhotoMapper.deleteUserLifePhotoById(id);
    }
}
